
import {reactive} from  'vue'

export default function(){
   
    const checkPhone = (rule, value, callback) => {
        //手机号校验
        if (!value) {
          return callback(new Error("请输入网易云手机号"));
        }
        const reg = /^1[3456789]\d{9}$/;
        if (!reg.test(value)) {
          callback(new Error("请输入有效的手机号码"));
        }
        callback();
      };
  
      const rules = reactive({
        phone: [{ validator: checkPhone, trigger: "blur" },{required: true,message: "请输入网易云手机号",trigger: 'blur'}],
        password: [{required: true,message: "请输入密码",trigger: 'blur'}]
      });

 

    return rules
 
}

